#ifndef LISTIO_H
#define LISTIO_H

#include <QDomElement>

class QFileInfo;
class QDomDocument;

class List;
class Item;
class Source;


class ListIO
{
public:
    ListIO();

    static const bool store(
        const QFileInfo &fileInfo
    ,   const List &list);

    static List *restore(
        const QFileInfo &fileInfo);

protected:

    static const QDomElement toItemElement(
        QDomDocument &document
    ,   const Item &item);

    static const QDomElement toSourceElement(
        QDomDocument &document
    ,   const Source &source);

    static Item *fromItemElement(
        List *list
    ,   const QDomElement &element);

    static Source *fromSourceElement(
        Item *item
    ,   const QDomElement &element);

};

#endif // LISTIO_H
